// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file radio_status.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "radio_status.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

radio_status::radio_status()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_rssi_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_rssi_ = 0;
    // m_remote_rssi_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_remote_rssi_ = 0;
    // m_txbuf_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_txbuf_ = 0;
    // m_noise_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_noise_ = 0;
    // m_remote_noise_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5b87ed94
    m_remote_noise_ = 0;
    // m_rxerrors_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6e0e048a
    m_rxerrors_ = 0;
    // m_fix_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@5bc79255
    m_fix_ = 0;

}

radio_status::~radio_status()
{








}

radio_status::radio_status(const radio_status &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_rssi_ = x.m_rssi_;
    m_remote_rssi_ = x.m_remote_rssi_;
    m_txbuf_ = x.m_txbuf_;
    m_noise_ = x.m_noise_;
    m_remote_noise_ = x.m_remote_noise_;
    m_rxerrors_ = x.m_rxerrors_;
    m_fix_ = x.m_fix_;
}

radio_status::radio_status(radio_status &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_rssi_ = x.m_rssi_;
    m_remote_rssi_ = x.m_remote_rssi_;
    m_txbuf_ = x.m_txbuf_;
    m_noise_ = x.m_noise_;
    m_remote_noise_ = x.m_remote_noise_;
    m_rxerrors_ = x.m_rxerrors_;
    m_fix_ = x.m_fix_;
}

radio_status& radio_status::operator=(const radio_status &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_rssi_ = x.m_rssi_;
    m_remote_rssi_ = x.m_remote_rssi_;
    m_txbuf_ = x.m_txbuf_;
    m_noise_ = x.m_noise_;
    m_remote_noise_ = x.m_remote_noise_;
    m_rxerrors_ = x.m_rxerrors_;
    m_fix_ = x.m_fix_;

    return *this;
}

radio_status& radio_status::operator=(radio_status &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_rssi_ = x.m_rssi_;
    m_remote_rssi_ = x.m_remote_rssi_;
    m_txbuf_ = x.m_txbuf_;
    m_noise_ = x.m_noise_;
    m_remote_noise_ = x.m_remote_noise_;
    m_rxerrors_ = x.m_rxerrors_;
    m_fix_ = x.m_fix_;

    return *this;
}

size_t radio_status::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);



    return current_alignment - initial_alignment;
}

size_t radio_status::getCdrSerializedSize(const radio_status& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 1 + eprosima::fastcdr::Cdr::alignment(current_alignment, 1);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);


    current_alignment += 2 + eprosima::fastcdr::Cdr::alignment(current_alignment, 2);



    return current_alignment - initial_alignment;
}

void radio_status::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_rssi_;
    scdr << m_remote_rssi_;
    scdr << m_txbuf_;
    scdr << m_noise_;
    scdr << m_remote_noise_;
    scdr << m_rxerrors_;
    scdr << m_fix_;
}

void radio_status::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_rssi_;
    dcdr >> m_remote_rssi_;
    dcdr >> m_txbuf_;
    dcdr >> m_noise_;
    dcdr >> m_remote_noise_;
    dcdr >> m_rxerrors_;
    dcdr >> m_fix_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void radio_status::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t radio_status::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& radio_status::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member rssi_
 * @param _rssi_ New value for member rssi_
 */
void radio_status::rssi_(uint8_t _rssi_)
{
m_rssi_ = _rssi_;
}

/*!
 * @brief This function returns the value of member rssi_
 * @return Value of member rssi_
 */
uint8_t radio_status::rssi_() const
{
    return m_rssi_;
}

/*!
 * @brief This function returns a reference to member rssi_
 * @return Reference to member rssi_
 */
uint8_t& radio_status::rssi_()
{
    return m_rssi_;
}

/*!
 * @brief This function sets a value in member remote_rssi_
 * @param _remote_rssi_ New value for member remote_rssi_
 */
void radio_status::remote_rssi_(uint8_t _remote_rssi_)
{
m_remote_rssi_ = _remote_rssi_;
}

/*!
 * @brief This function returns the value of member remote_rssi_
 * @return Value of member remote_rssi_
 */
uint8_t radio_status::remote_rssi_() const
{
    return m_remote_rssi_;
}

/*!
 * @brief This function returns a reference to member remote_rssi_
 * @return Reference to member remote_rssi_
 */
uint8_t& radio_status::remote_rssi_()
{
    return m_remote_rssi_;
}

/*!
 * @brief This function sets a value in member txbuf_
 * @param _txbuf_ New value for member txbuf_
 */
void radio_status::txbuf_(uint8_t _txbuf_)
{
m_txbuf_ = _txbuf_;
}

/*!
 * @brief This function returns the value of member txbuf_
 * @return Value of member txbuf_
 */
uint8_t radio_status::txbuf_() const
{
    return m_txbuf_;
}

/*!
 * @brief This function returns a reference to member txbuf_
 * @return Reference to member txbuf_
 */
uint8_t& radio_status::txbuf_()
{
    return m_txbuf_;
}

/*!
 * @brief This function sets a value in member noise_
 * @param _noise_ New value for member noise_
 */
void radio_status::noise_(uint8_t _noise_)
{
m_noise_ = _noise_;
}

/*!
 * @brief This function returns the value of member noise_
 * @return Value of member noise_
 */
uint8_t radio_status::noise_() const
{
    return m_noise_;
}

/*!
 * @brief This function returns a reference to member noise_
 * @return Reference to member noise_
 */
uint8_t& radio_status::noise_()
{
    return m_noise_;
}

/*!
 * @brief This function sets a value in member remote_noise_
 * @param _remote_noise_ New value for member remote_noise_
 */
void radio_status::remote_noise_(uint8_t _remote_noise_)
{
m_remote_noise_ = _remote_noise_;
}

/*!
 * @brief This function returns the value of member remote_noise_
 * @return Value of member remote_noise_
 */
uint8_t radio_status::remote_noise_() const
{
    return m_remote_noise_;
}

/*!
 * @brief This function returns a reference to member remote_noise_
 * @return Reference to member remote_noise_
 */
uint8_t& radio_status::remote_noise_()
{
    return m_remote_noise_;
}

/*!
 * @brief This function sets a value in member rxerrors_
 * @param _rxerrors_ New value for member rxerrors_
 */
void radio_status::rxerrors_(uint16_t _rxerrors_)
{
m_rxerrors_ = _rxerrors_;
}

/*!
 * @brief This function returns the value of member rxerrors_
 * @return Value of member rxerrors_
 */
uint16_t radio_status::rxerrors_() const
{
    return m_rxerrors_;
}

/*!
 * @brief This function returns a reference to member rxerrors_
 * @return Reference to member rxerrors_
 */
uint16_t& radio_status::rxerrors_()
{
    return m_rxerrors_;
}

/*!
 * @brief This function sets a value in member fix_
 * @param _fix_ New value for member fix_
 */
void radio_status::fix_(uint16_t _fix_)
{
m_fix_ = _fix_;
}

/*!
 * @brief This function returns the value of member fix_
 * @return Value of member fix_
 */
uint16_t radio_status::fix_() const
{
    return m_fix_;
}

/*!
 * @brief This function returns a reference to member fix_
 * @return Reference to member fix_
 */
uint16_t& radio_status::fix_()
{
    return m_fix_;
}


size_t radio_status::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;











    return current_align;
}

bool radio_status::isKeyDefined()
{
   return false;
}

void radio_status::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
}
